
/*

	SpaceShooter 
		Classic space shooter game

	by Felipe

	03/11/2011 - 23:15

*/

#ifndef		__SPACESHOOTER_H
#define		__SPACESHOOTER_H

#include	<SDL\SDL.h>
#include	<SDL\SDL_ttf.h>
#include	<vector>
#include	<cstdlib>
#include	<ctime>

#include	"Event.h"
#include	"FPS.h"
#include	"Surface.h"
#include	"SpaceBackground.h"
#include	"Ship.h"
#include	"Enemy.h"
#include	"Util.h"
#include	"Animation.h"
#include	"Texto.h"

class SpaceShooter : public Event {

	private:
		SDL_Surface* dispSurface;
		bool running;
		char windowTitle[45];

		enum gameStates {
			MENU = 1,
			INGAME,
			INGAME_MENU,
			POSTGAME
		} gameState;

		SpaceBackground spaceBg;
		Ship	ship;
		Enemy	enemyShip; //test

		int enemySpawnTimer;

		//Anims
		Animation	explosionAnim;

		//Texts
		Texto	healthText;

	public:
		SpaceShooter();

		static std::vector<Object*> objectList;
		std::vector<Animation> animationList;
		std::vector<Texto*> textList;

		int execute();

		bool init();
		bool initTexts();
		void loop();
		void render();
		void cleanup();

		//From Event
		void OnExit();
		void OnKeyDown(SDLKey sym, SDLMod mod, Uint16 unicode);
		void OnKeyUp(SDLKey sym, SDLMod mod, Uint16 unicode);

		static Object*	getPlayerShip();

};

#endif
